Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 1.38 KB

Missed Fail Rotten Green Test.rst

File metadata and controls

32 lines (23 loc) · 1.38 KB

Missed Fail Rotten Green Test

Definition:

  • Tests where the test engineer passes to an assertion primitive to force the test to fail. Such assertion calls are intended to be executed only if something goes wrong, and not if the test passes.

Code Example:

@Test
public void testMethod() {
    MyClass obj = new MyClass();
    int expected = 5;
    int actual = obj.doSomething();
    assertTrue(actual > 0);
    assertFalse(actual > 10);
    fail("Something went wrong");
}

References:

Quality attributes